<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        print '<p>'.'helloooooo'.'</p>';
        $price=array(100,20,1);
        asort($price);           #sort by value
        ksort($price);           #sort by key
        foreach ($price as $value) {
            echo $value.'</br>';
        }
//        $server='localhost';
//        $username='root';
//        $password='1234';
//        $conn=  mysql_connect($server, $username, $password);
//        if ($conn){
//            echo 'successful';
//        }
//        else {
//            echo 'failed';
//            die('Could not connect: '.mysql_error($conn));
//        }
//        mysql_close($conn);
        $fruit=array(1=>"oranges","apple","bananas");
        $color=array(2=>"red","green",'blue','purple');
        sort($color);   #rsort(),asort(),arsort(),ksort(),krsort()   a-> value  k->key    r->reverse
        shuffle($color);
        $c=array($fruit,$color);
        print_r($c);
        echo "<br>";
        foreach ($c as $key => $value) {
            foreach($value as $x => $y){
//                var_dump($value);
                echo "$x\t".":$y";
            }
            echo "</br>";
        }
        $cc=range("zz","tt");
        print_r($cc);
        $string =  implode('||',$color);
        print_r($string);
        $str1='jiangkai';
        $str2='jiangkai';
        echo '<pre>'.'sha1'.sha1($str1,TRUE);
        echo 'md5'.md5($str2,TRUE);
        echo "<br>";
        echo mktime(8,0,0,1,1,1970);
        echo 'port:'.getenv('SERVER_PORT');
        $http='http://www.jiangkai.com:80/php/jf?id=100&cid=900';
        echo '<pre>';
        print_r(parse_url($http));
        if (md5($str1)==md5($str2)){
            echo "md5 is same";
        }
        else{
            echo "different";
        }
        echo 8%(-7);
//        ereg();
//        preg_grep();
        ?>
    </body>
</html>
